diff --git a/doc/device-tree-bindings/regulator/fan53555.txt b/doc/device-tree-bindings/regulator/fan53555.txt
new file mode 100644
index 0000000..b183738
--- /dev/null
+++ b/doc/device-tree-bindings/regulator/fan53555.txt
@@ -0,0 +1,23 @@
+Binding for Fairchild FAN53555 regulators
+
+Required properties:
+  - compatible: "fcs,fan53555"
+  - reg: I2C address
+
+Optional properties:
+  - fcs,suspend-voltage-selector: declare which of the two available
+		voltage selector registers should be used for the suspend
+		voltage. The other one is used for the runtime voltage setting
+		Possible values are either <0> or <1>
+  - vin-supply: regulator supplying the vin pin
+
+Example:
+
+	regulator@40 {
+		compatible = "fcs,fan53555";
+		regulator-name = "fan53555";
+		regulator-min-microvolt = <1000000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&parent_reg>;
+		fcs,suspend-voltage-selector = <1>;
+	};
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index cba48e1..8cf60eb 100644
--- a/drivers/power/pmic/Kconfig
+++ b/drivers/power/pmic/Kconfig
@@ -48,6 +48,20 @@
 	  interface and is designs to cover most of the power managementment
 	  required for a tablets or laptop.
 
+config DM_PMIC_FAN53555
+	bool "Enable support for OnSemi FAN53555"
+	depends on DM_PMIC && DM_REGULATOR && DM_I2C
+	select DM_REGULATOR_FAN53555
+	help
+	  This config enables implementation of driver-model PMIC
+	  uclass features for the FAN53555 regulator. The FAN53555 is
+	  a (family of) single-output regulators that supports
+	  transitioning between two different output voltages based on
+	  an voltage selection pin.
+
+	  The driver implements read/write operations for use with the FAN53555
+	  regulator driver and binds the regulator driver to its node.
+
 config DM_PMIC_PFUZE100
 	bool "Enable Driver Model for PMIC PFUZE100"
 	depends on DM_PMIC
diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index 29ca442..637352a 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -4,6 +4,7 @@
 # Lukasz Majewski <l.majewski@samsung.com>
 
 obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
+obj-$(CONFIG_DM_PMIC_FAN53555) += fan53555.o
 obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o
 obj-$(CONFIG_DM_PMIC_MAX8998) += max8998.o
 obj-$(CONFIG_DM_PMIC_MC34708) += mc34708.o
diff --git a/drivers/power/pmic/fan53555.c b/drivers/power/pmic/fan53555.c
new file mode 100644
index 0000000..1ca59c5
--- /dev/null
+++ b/drivers/power/pmic/fan53555.c
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) 2018 Theobroma Systems Design und Consulting GmbH
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+
+static int pmic_fan53555_reg_count(struct udevice *dev)
+{
+	return 1;
+};
+
+static int pmic_fan53555_read(struct udevice *dev, uint reg,
+			      u8 *buff, int len)
+{
+	if (dm_i2c_read(dev, reg, buff, len)) {
+		pr_err("%s: read error for register: %#x!", dev->name, reg);
+		return -EIO;
+	}
+
+	return 0;
+}
+
+static int pmic_fan53555_write(struct udevice *dev, uint reg,
+			       const u8 *buff, int len)
+{
+	if (dm_i2c_write(dev, reg, buff, len)) {
+		pr_err("%s: write error for register: %#x!", dev->name, reg);
+		return -EIO;
+	}
+
+	return 0;
+}
+
+static int pmic_fan53555_bind(struct udevice *dev)
+{
+	/*
+	 * The FAN53555 has only a single regulator and therefore doesn't
+	 * have a subnode.  So we have to rebind a child device (the one
+	 * regulator) here.
+	 */
+
+	const char *regulator_driver_name = "fan53555_regulator";
+	struct udevice *child;
+	struct driver *drv;
+
+	debug("%s\n", __func__);
+
+	drv = lists_driver_lookup_name(regulator_driver_name);
+	if (!drv) {
+		dev_err(dev, "no driver '%s'\n", regulator_driver_name);
+		return -ENOENT;
+	}
+
+	return device_bind_with_driver_data(dev, drv, "SW", 0,
+					    dev_ofnode(dev), &child);
+};
+
+static struct dm_pmic_ops pmic_fan53555_ops = {
+	.reg_count = pmic_fan53555_reg_count,
+	.read = pmic_fan53555_read,
+	.write = pmic_fan53555_write,
+};
+
+static const struct udevice_id pmic_fan53555_match[] = {
+	{ .compatible = "fcs,fan53555" },
+	{ },
+};
+
+U_BOOT_DRIVER(pmic_fan53555) = {
+	.name = "pmic_fan53555",
+	.id = UCLASS_PMIC,
+	.of_match = pmic_fan53555_match,
+	.bind = pmic_fan53555_bind,
+	.ops = &pmic_fan53555_ops,
+};
diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index 2561a8a..09b311d 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -69,6 +69,22 @@
 	features for REGULATOR MAX77686. The driver implements get/set api for:
 	value, enable and mode.
 
+config DM_REGULATOR_FAN53555
+	bool "Enable Driver Model for REGULATOR FAN53555"
+	depends on DM_PMIC_FAN53555
+	help
+	  This config enables implementation of driver-model regulator
+	  uclass features for the FAN53555 regulator. The FAN53555 is
+	  a (family of) single-output regulators that supports
+	  transitioning between two different output voltages based on
+	  an voltage selection pin.
+
+	  The driver implements a get/set api for the voltage of the
+	  'normal mode' voltage only. Switching to 'suspend mode'
+	  (i.e. the alternate voltage), disabling output via software,
+	  or switching the mode is not supported by this driver (at
+	  this time).
+
 config DM_REGULATOR_FIXED
 	bool "Enable Driver Model for REGULATOR Fixed value"
 	depends on DM_REGULATOR
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index a5f5683..8017045 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -10,6 +10,7 @@
 obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 obj-$(CONFIG_$(SPL_)DM_PMIC_PFUZE100) += pfuze100.o
 obj-$(CONFIG_REGULATOR_PWM) += pwm_regulator.o
+obj-$(CONFIG_$(SPL_)DM_REGULATOR_FAN53555) += fan53555.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_FIXED) += fixed.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_GPIO) += gpio-regulator.o
 obj-$(CONFIG_REGULATOR_RK8XX) += rk8xx.o
diff --git a/drivers/power/regulator/fan53555.c b/drivers/power/regulator/fan53555.c
new file mode 100644
index 0000000..dbd5502
--- /dev/null
+++ b/drivers/power/regulator/fan53555.c
@@ -0,0 +1,222 @@
+// SPDX-License-Identifier:     GPL-2.0+
+/*
+ * (C) 2018 Theobroma Systems Design und Consulting GmbH
+ */
+
+#include <common.h>
+#include <bitfield.h>
+#include <errno.h>
+#include <dm.h>
+#include <fdtdec.h>
+#include <i2c.h>
+#include <asm/gpio.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+
+/**
+ * struct ic_types - definition of fan53555-family devices
+ *
+ * @die_id: Identifies the DIE_ID (lower nibble of the ID1 register)
+ * @die_rev: Identifies the DIE_REV (lower nibble of the ID2 register)
+ * @vsel_min: starting voltage (step 0) in uV
+ * @vsel_step: increment of the voltage in uV
+ *
+ * The voltage ramp (i.e. minimum voltage and step) is selected from the
+ * combination of 2 nibbles: DIE_ID and DIE_REV.
+ *
+ * See http://www.onsemi.com/pub/Collateral/FAN53555-D.pdf for details.
+ */
+static const struct {
+	u8 die_id;
+	u8 die_rev;
+	u32 vsel_min;
+	u32 vsel_step;
+} ic_types[] = {
+	{ 0x0, 0x3, 600000, 10000 },  /* Option 00 */
+	{ 0x0, 0xf, 800000, 10000 },  /* Option 13 */
+	{ 0x0, 0xc, 600000, 12500 },  /* Option 23 */
+	{ 0x1, 0x3, 600000, 10000 },  /* Option 01 */
+	{ 0x3, 0x3, 600000, 10000 },  /* Option 03 */
+	{ 0x4, 0xf, 603000, 12826 },  /* Option 04 */
+	{ 0x5, 0x3, 600000, 10000 },  /* Option 05 */
+	{ 0x8, 0x1, 600000, 10000 },  /* Option 08 */
+	{ 0x8, 0xf, 600000, 10000 },  /* Option 08 */
+	{ 0xc, 0xf, 603000, 12826 },  /* Option 09 */
+};
+
+/* I2C-accessible byte-sized registers */
+enum {
+	/* Voltage setting */
+	FAN53555_VSEL0 = 0x00,
+	FAN53555_VSEL1,
+	/* Control register */
+	FAN53555_CONTROL,
+	/* IC Type */
+	FAN53555_ID1,
+	/* IC mask version */
+	FAN53555_ID2,
+	/* Monitor register */
+	FAN53555_MONITOR,
+};
+
+struct fan53555_platdata {
+	/* Voltage setting register */
+	unsigned int vol_reg;
+	unsigned int sleep_reg;
+
+};
+
+struct fan53555_priv {
+	/* IC Vendor */
+	unsigned int vendor;
+	/* IC Type and Rev */
+	unsigned int die_id;
+	unsigned int die_rev;
+	/* Voltage range and step(linear) */
+	unsigned int vsel_min;
+	unsigned int vsel_step;
+	/* Voltage slew rate limiting */
+	unsigned int slew_rate;
+	/* Sleep voltage cache */
+	unsigned int sleep_vol_cache;
+};
+
+static int fan53555_regulator_ofdata_to_platdata(struct udevice *dev)
+{
+	struct fan53555_platdata *dev_pdata = dev_get_platdata(dev);
+	struct dm_regulator_uclass_platdata *uc_pdata =
+		dev_get_uclass_platdata(dev);
+	u32 sleep_vsel;
+
+	/* This is a buck regulator */
+	uc_pdata->type = REGULATOR_TYPE_BUCK;
+
+	sleep_vsel = dev_read_u32_default(dev, "fcs,suspend-voltage-selector",
+					  FAN53555_VSEL1);
+
+	/*
+	 * Depending on the device-tree settings, the 'normal mode'
+	 * voltage is either controlled by VSEL0 or VSEL1.
+	 */
+	switch (sleep_vsel) {
+	case FAN53555_VSEL0:
+		dev_pdata->sleep_reg = FAN53555_VSEL0;
+		dev_pdata->vol_reg = FAN53555_VSEL1;
+		break;
+	case FAN53555_VSEL1:
+		dev_pdata->sleep_reg = FAN53555_VSEL1;
+		dev_pdata->vol_reg = FAN53555_VSEL0;
+		break;
+	default:
+		pr_err("%s: invalid vsel id %d\n", dev->name, sleep_vsel);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int fan53555_regulator_get_value(struct udevice *dev)
+{
+	struct fan53555_platdata *pdata = dev_get_platdata(dev);
+	struct fan53555_priv *priv = dev_get_priv(dev);
+	int reg;
+	int voltage;
+
+	/* We only support a single voltage selector (i.e. 'normal' mode). */
+	reg = pmic_reg_read(dev->parent, pdata->vol_reg);
+	if (reg < 0)
+		return reg;
+	voltage = priv->vsel_min + (reg & 0x3f) * priv->vsel_step;
+
+	debug("%s: %d uV\n", __func__, voltage);
+	return voltage;
+}
+
+static int fan53555_regulator_set_value(struct udevice *dev, int uV)
+{
+	struct fan53555_platdata *pdata = dev_get_platdata(dev);
+	struct fan53555_priv *priv = dev_get_priv(dev);
+	u8 vol;
+
+	vol = (uV - priv->vsel_min) / priv->vsel_step;
+	debug("%s: uV=%d; writing volume %d: %02x\n",
+	      __func__, uV, pdata->vol_reg, vol);
+
+	return pmic_clrsetbits(dev, pdata->vol_reg, GENMASK(6, 0), vol);
+}
+
+static int fan53555_voltages_setup(struct udevice *dev)
+{
+	struct fan53555_priv *priv = dev_get_priv(dev);
+	int i;
+
+	/* Init voltage range and step */
+	for (i = 0; i < ARRAY_SIZE(ic_types); ++i) {
+		if (ic_types[i].die_id != priv->die_id)
+			continue;
+
+		if (ic_types[i].die_rev != priv->die_rev)
+			continue;
+
+		priv->vsel_min = ic_types[i].vsel_min;
+		priv->vsel_step = ic_types[i].vsel_step;
+
+		return 0;
+	}
+
+	pr_err("%s: %s: die id %d rev %d not supported!\n",
+	       dev->name, __func__, priv->die_id, priv->die_rev);
+	return -EINVAL;
+}
+
+enum {
+	DIE_ID_SHIFT = 0,
+	DIE_ID_WIDTH = 4,
+	DIE_REV_SHIFT = 0,
+	DIE_REV_WIDTH = 4,
+};
+
+static int fan53555_probe(struct udevice *dev)
+{
+	struct fan53555_priv *priv = dev_get_priv(dev);
+	int ID1, ID2;
+
+	debug("%s\n", __func__);
+
+	/* read chip ID1 and ID2 (two registers, starting at ID1) */
+	ID1 = pmic_reg_read(dev->parent, FAN53555_ID1);
+	if (ID1 < 0)
+		return ID1;
+
+	ID2 = pmic_reg_read(dev->parent, FAN53555_ID2);
+	if (ID2 < 0)
+		return ID2;
+
+	/* extract vendor, die_id and die_rev */
+	priv->vendor = bitfield_extract(ID1, 5, 3);
+	priv->die_id = ID1 & GENMASK(3, 0);
+	priv->die_rev = ID2 & GENMASK(3, 0);
+
+	if (fan53555_voltages_setup(dev) < 0)
+		return -ENODATA;
+
+	debug("%s: FAN53555 option %d rev %d detected\n",
+	      __func__, priv->die_id, priv->die_rev);
+
+	return 0;
+}
+
+static const struct dm_regulator_ops fan53555_regulator_ops = {
+	.get_value	= fan53555_regulator_get_value,
+	.set_value	= fan53555_regulator_set_value,
+};
+
+U_BOOT_DRIVER(fan53555_regulator) = {
+	.name = "fan53555_regulator",
+	.id = UCLASS_REGULATOR,
+	.ops = &fan53555_regulator_ops,
+	.ofdata_to_platdata = fan53555_regulator_ofdata_to_platdata,
+	.platdata_auto_alloc_size = sizeof(struct fan53555_platdata),
+	.priv_auto_alloc_size = sizeof(struct fan53555_priv),
+	.probe = fan53555_probe,
+};
